/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.tubosmonterrey.cotizador.tb;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author rsoberanis
 */
@Entity
@Table(name = "tbusuarios")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tbusuarios.findAll", query = "SELECT t FROM Tbusuarios t"),
    @NamedQuery(name = "Tbusuarios.findByUser", query = "SELECT t FROM Tbusuarios t WHERE t.user = :user"),
    @NamedQuery(name = "Tbusuarios.findByNom", query = "SELECT t FROM Tbusuarios t WHERE t.nom = :nom"),
    @NamedQuery(name = "Tbusuarios.findByStatus", query = "SELECT t FROM Tbusuarios t WHERE t.status = :status"),
    @NamedQuery(name = "Tbusuarios.findByPassword", query = "SELECT t FROM Tbusuarios t WHERE t.password = :password")})
public class Tbusuarios implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "user")
    private String user;
    @Column(name = "nom")
    private String nom;
    @Column(name = "status")
    private Integer status;
    @Column(name = "password")
    private String password;
    @JoinColumn(name = "perfil", referencedColumnName = "id")
    @ManyToOne
    private Tbperfil perfil;

    public Tbusuarios() {
    }

    public Tbusuarios(String user) {
        this.user = user;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getNom() {
        return nom;
    }

    public void setNom(String nom) {
        this.nom = nom;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Tbperfil getPerfil() {
        return perfil;
    }

    public void setPerfil(Tbperfil perfil) {
        this.perfil = perfil;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (user != null ? user.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tbusuarios)) {
            return false;
        }
        Tbusuarios other = (Tbusuarios) object;
        if ((this.user == null && other.user != null) || (this.user != null && !this.user.equals(other.user))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.tubosmonterrey.cotizador.tb.Tbusuarios[ user=" + user + " ]";
    }
    
}
